﻿<Activity mc:Ignorable="sads sap" x:Class="TestProject1.GetVMsTestWorkflow"
 xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System"
 xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
 xmlns:s="clr-namespace:System;assembly=mscorlib"
 xmlns:s1="clr-namespace:System;assembly=System"
 xmlns:s2="clr-namespace:System;assembly=System.Xml"
 xmlns:s3="clr-namespace:System;assembly=System.Core"
 xmlns:s4="clr-namespace:System;assembly=System.ServiceModel"
 xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities"
 xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities"
 xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
 xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
 xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
 xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System"
 xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel"
 xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=System.Core"
 xmlns:sd="clr-namespace:System.Data;assembly=System.Data"
 xmlns:sl="clr-namespace:System.Linq;assembly=System.Core"
 xmlns:st="clr-namespace:System.Text;assembly=mscorlib"
 xmlns:t="clr-namespace:TestProject1"
 xmlns:v="clr-namespace:VMWareActivities;assembly=VMWareActivities"
 xmlns:vv="clr-namespace:VMware.Vim;assembly=VMware.Vim"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <x:Members>
    <x:Property Name="ServerName" Type="InArgument(x:String)" />
    <x:Property Name="ServerCommunicationProtocol" Type="InArgument(s:Nullable(vv:CommunicationProtocol))" />
    <x:Property Name="ServerPort" Type="InArgument(x:Int16)" />
    <x:Property Name="UserName" Type="InArgument(x:String)" />
    <x:Property Name="Password" Type="InArgument(x:String)" />
    <x:Property Name="EnvironmentNames" Type="InArgument(scg:List(x:String))" />
    <x:Property Name="FoundVM" Type="OutArgument(vv:VirtualMachine)" />
  </x:Members>
  <sap:VirtualizedContainerService.HintSize>703,1658</sap:VirtualizedContainerService.HintSize>
  <mva:VisualBasic.Settings>Assembly references and imported namespaces for internal implementation</mva:VisualBasic.Settings>
  <Sequence DisplayName="MainWorkflow" sad:XamlDebuggerXmlReader.FileName="C:\Projects\artiso_ALMTools\VMWareLab\Main\TestProject1\GetVMsTestsWorkflow.xaml" sap:VirtualizedContainerService.HintSize="663,1618">
    <Sequence.Variables>
      <Variable x:TypeArguments="vv:VimClient" Name="vMWareConnection" />
    </Sequence.Variables>
    <sap:WorkflowViewStateService.ViewState>
      <scg:Dictionary x:TypeArguments="x:String, x:Object">
        <x:Boolean x:Key="IsExpanded">True</x:Boolean>
      </scg:Dictionary>
    </sap:WorkflowViewStateService.ViewState>
    <Assign sap:VirtualizedContainerService.HintSize="641,60">
      <Assign.To>
        <OutArgument x:TypeArguments="scg:List(x:String)">[EnvironmentNames]</OutArgument>
      </Assign.To>
      <Assign.Value>
        <InArgument x:TypeArguments="scg:List(x:String)">[New List(Of String)({"Win7 (x64)"})]</InArgument>
      </Assign.Value>
    </Assign>
    <v:ConnectToVMWareServerActivity sap:VirtualizedContainerService.HintSize="641,22" Password="[Password]" ServerCommunicationProtocol="[ServerCommunicationProtocol]" ServerName="[ServerName]" ServerPort="[CUShort(ServerPort)]" UserName="[UserName]" VMWareConnection="[vMWareConnection]" />
    <ForEach x:TypeArguments="x:String" DisplayName="ForEach&lt;String&gt;" sap:VirtualizedContainerService.HintSize="641,626" Values="[EnvironmentNames]">
      <ActivityAction x:TypeArguments="x:String">
        <ActivityAction.Argument>
          <DelegateInArgument x:TypeArguments="x:String" Name="envName" />
        </ActivityAction.Argument>
        <Sequence DisplayName="RestoreSnapshot" sap:VirtualizedContainerService.HintSize="486,518">
          <Sequence.Variables>
            <Variable x:TypeArguments="vv:VirtualMachinePowerState" Name="vmPowerState" />
          </Sequence.Variables>
          <sap:WorkflowViewStateService.ViewState>
            <scg:Dictionary x:TypeArguments="x:String, x:Object">
              <x:Boolean x:Key="IsExpanded">True</x:Boolean>
            </scg:Dictionary>
          </sap:WorkflowViewStateService.ViewState>
          <v:GetVMsActivity EnvironmentName="[envName]" FoundVM="[FoundVM]" sap:VirtualizedContainerService.HintSize="464,22" VMWareConnection="[vMWareConnection]" />
          <v:RestoreSnapshotAcitvity sap:VirtualizedContainerService.HintSize="464,22" SnapshotPath="Snapshot 1" VirtualMachine="[FoundVM]" />
          <v:GetVMPowerStateActivity sap:VirtualizedContainerService.HintSize="464,22" VirtualMachine="[FoundVM]" VirtualMachinePowerState="[vmPowerState]" />
          <If Condition="[vmPowerState &lt;&gt; VirtualMachinePowerState.poweredOn]" sap:VirtualizedContainerService.HintSize="464,208">
            <If.Then>
              <v:PowerOnVMAcitvity sap:VirtualizedContainerService.HintSize="269,100" VirtualMachine="[FoundVM]" />
            </If.Then>
          </If>
        </Sequence>
      </ActivityAction>
    </ForEach>
    <If Condition="False" DisplayName="If snapshot is needed" sap:VirtualizedContainerService.HintSize="641,666">
      <sap:WorkflowViewStateService.ViewState>
        <scg:Dictionary x:TypeArguments="x:String, x:Object">
          <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          <x:Boolean x:Key="IsPinned">False</x:Boolean>
        </scg:Dictionary>
      </sap:WorkflowViewStateService.ViewState>
      <If.Then>
        <ForEach x:TypeArguments="x:String" DisplayName="ForEach&lt;String&gt;" sap:VirtualizedContainerService.HintSize="516,560" Values="[EnvironmentNames]">
          <ActivityAction x:TypeArguments="x:String">
            <ActivityAction.Argument>
              <DelegateInArgument x:TypeArguments="x:String" Name="vmName" />
            </ActivityAction.Argument>
            <Sequence DisplayName="Take snapshot" sap:VirtualizedContainerService.HintSize="486,454">
              <Sequence.Variables>
                <Variable x:TypeArguments="vv:VirtualMachinePowerState" Name="snapshotVmPowerState" />
              </Sequence.Variables>
              <sap:WorkflowViewStateService.ViewState>
                <scg:Dictionary x:TypeArguments="x:String, x:Object">
                  <x:Boolean x:Key="IsExpanded">True</x:Boolean>
                </scg:Dictionary>
              </sap:WorkflowViewStateService.ViewState>
              <v:GetVMsActivity EnvironmentName="[vmName]" FoundVM="[FoundVM]" sap:VirtualizedContainerService.HintSize="464,22" VMWareConnection="[vMWareConnection]" />
              <v:GetVMPowerStateActivity sap:VirtualizedContainerService.HintSize="464,22" VirtualMachine="[FoundVM]" VirtualMachinePowerState="[snapshotVmPowerstate]" />
              <If Condition="[snapshotVmPowerState &lt;&gt; VirtualMachinePowerState.poweredOn]" sap:VirtualizedContainerService.HintSize="464,206">
                <If.Then>
                  <v:PowerOnVMAcitvity sap:VirtualizedContainerService.HintSize="269,100" VirtualMachine="[FoundVM]" />
                </If.Then>
              </If>
            </Sequence>
          </ActivityAction>
        </ForEach>
      </If.Then>
    </If>
  </Sequence>
</Activity>